FROM dockerproxy.cn/alpine/git:2.45.2 as git

WORKDIR /app
# 在 Dockerfile 开头添加环境变量
ARG GITLAB_TOKEN=PCRBvaxZ5ynyPS7FHNyh

ENV GITLAB_TOKEN=${GITLAB_TOKEN}


# 克隆 GitLab 仓库（请更改为你的仓库地址）
RUN git clone --depth 1 --branch master https://oauth2:${GITLAB_TOKEN}@gitlab.datacanvas.com/ydyd/wedding-agent.git .

FROM dockerproxy.net/library/python:3.10.15-slim as python

# 设置工作目录
WORKDIR /app

COPY --from=git /app /app

RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple 

# 暴露 agent 默认端口
EXPOSE 8090

# 启动 agent
CMD ["python", "app.py"]


# docker build --no-cache --build-arg GITLAB_TOKEN=PCRBvaxZ5ynyPS7FHNyh -t tableagent-registry.cn-beijing.cr.aliyuncs.com/wedding/wedding-agent:1.0.0 .

# docker push tableagent-registry.cn-beijing.cr.aliyuncs.com/wedding/wedding-agent:1.0.0
